using System;

class EX2
{
    public static void Main()
    {
        // ShowNumbers();
        ConsoleBack();
    }

    //1.计算完数
    private static void ShowNumbers()
    {
        int i, j, s, n = 100000;  /*变量i控制选定数范围，j控制除数范围，s记录累加因子之和*/
        Console.WriteLine("1-100000范围完数：");
        for (i = 2; i <= n; i++)
        {
            s = 0;  /*保证每次循环时s的初值为0*/
            for (j = 1; j < i; j++)
            {
                if (i % j == 0)  /*判断j是否为i的因子*/
                    s += j;
            }
            if (s == i)  /*判断因子这和是否和原数相等*/
                Console.WriteLine(i);
        }
    }

    //3.控制台回显
    private static void ConsoleBack()
    {
        Console.WriteLine("请输入一句话");
        string input = Console.ReadLine();
        char[] chars = input.ToCharArray();
        foreach(char item in chars) {
            Console.WriteLine(item + "是" + JudgeType(item) + "类型");
        }
    }

    //判断字符类型
    private static string JudgeType(char c) {
        int code = (int)c;
        if (code >= 32 && code <= 47) return "符号";
        if (code >=48 &&  code <= 57) return "数字";
        if (code >= 58 && code <= 64) return "符号";
        if (code >= 65 && code <= 90) return "大写字母";
        if (code >= 91 && code <= 96) return "符号";
        if (code >= 97 && code <= 122) return "小写字母";
        return "未知";
    }
}
